app_family.controller("controller_assesshistory", function($scope, $rootScope, httpRequest, $location) {
	$rootScope.$broadcast('currentModule', 'assesshistory');
	$scope.imagebasepath = imagebasepath;
	
	/**
	 * 判断是否用手机登录过
	 */
	if (sessionStorage.getItem('data_sessionStorage')) {
		var familyPhone = JSON.parse(sessionStorage.getItem('data_sessionStorage')).familyInfo.phone;
		if (familyPhone == '' || familyPhone == null) {
			window.location.replace(basepath + 'login.html');
			return;
		}
	} else {
		window.location.replace(basepath + 'login.html');
		return;
	}
	httpRequest.getOlderAssessRecord({
		mobile : familyPhone
	}, function (data) {
		if (data.success === true) {
			$scope.assessList =  data.obj;
		} else if (data.success === false) {
			$.dialog.showToast({msgTxt : data.msg});
		}
	});
	
	/**
	 * 获取评估建议
	 */
	$scope.toAssessAdv = function (assessment_record_id) {
		// 保存评估记录id到sessionStorage
		data_sessionStorage = JSON.parse(sessionStorage.getItem('data_sessionStorage'));
		data_sessionStorage.assInfo.ass_advice_record_id = assessment_record_id;
		sessionStorage.setItem('data_sessionStorage', JSON.stringify(data_sessionStorage));
		
		// 跳转页面到评估建议
		$location.path('/assessadvice');
		$scope.$apply();
	};
});